﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Yz.Base;

namespace Yz.Cache.Redis
{
    public interface IRedisMq
    {
        long Publish<T>(ParaCacheMq paraCacheMq, List<T> list);
        long Publish<T>(ParaCacheMq paraCacheMq, T model);
        Task<long> PublishAsync<T>(ParaCacheMq paraCacheMq, T model);
        Task<long> PublishAsync<T>(ParaCacheMq paraCacheMq, List<T> list);
        void Subscribe(ParaCacheMq paraCacheMq, Delegate handler);
        Task SubscribeAsync(ParaCacheMq paraCacheMq, Delegate callBack);
        void Unsubscribe(ParaCacheMq paraCacheMq);
        void UnsubscribeAll(int dbNum);
        Task UnsubscribeAllAsync(int dbNum);
        Task UnsubscribeAsync(ParaCacheMq paraCacheMq);
    }
}